package com.huage_02;

public class Phone {
    //成员变量
    private String brand;
    private int price;

    //构造方法
    public Phone(){}
    public Phone(String brand){
        this.brand = brand;
    }
    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        if(price<0){
            System.out.println("你输入的价格有误，请检查后再输");
        }else {
            this.price = price;
        }
    }

    //成员方法
    public void call(){
        System.out.println("打电话");
    }
    public void sendMessage(){
        System.out.println("发短信");
    }
}
